<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>EquTemper: Interface</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="$relpath<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="$relpath<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>/search.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript">
$(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<div id="top"><!-- do not remove this div! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">EquTemper&#160;<span id="projectnumber">1.01</span></div>
   <div id="projectbrief">An equation editor.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- Generated by Doxygen 1.7.4 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<script type="text/javascript">
function hasClass(ele,cls) {
  return ele.className.match(new RegExp('(\\s|^)'+cls+'(\\s|$)'));
}

function addClass(ele,cls) {
  if (!this.hasClass(ele,cls)) ele.className += " "+cls;
}

function removeClass(ele,cls) {
  if (hasClass(ele,cls)) {
    var reg = new RegExp('(\\s|^)'+cls+'(\\s|$)');
    ele.className=ele.className.replace(reg,' ');
  }
}

function toggleVisibility(linkObj) {
 var base = linkObj.getAttribute('id');
 var summary = document.getElementById(base + '-summary');
 var content = document.getElementById(base + '-content');
 var trigger = document.getElementById(base + '-trigger');
 if ( hasClass(linkObj,'closed') ) {
   summary.style.display = 'none';
   content.style.display = 'block';
   trigger.src = 'open.png';
   removeClass(linkObj,'closed');
   addClass(linkObj,'opened');
 } else if ( hasClass(linkObj,'opened') ) {
   summary.style.display = 'block';
   content.style.display = 'none';
   trigger.src = 'closed.png';
   removeClass(linkObj,'opened');
   addClass(linkObj,'closed');
 }
 return false;
}
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li id="searchli">
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('sec_interface.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">Interface </div>  </div>
</div>
<div class="contents">
<div class="textblock"><p>The user of the code makes use of following elements:</p>
<ul>
<li>Initialization code may look like this: <div class="fragment"><pre class="fragment"><span class="comment">// the code is assumed to be placed in a method belonging to a widget</span>
<span class="preprocessor">#if     (ENABLE_DDHC == 1)</span>
<span class="preprocessor"></span>
    <span class="comment">// create a treeview and set it up the way you like</span>
    QTreeView * tv_tree_ddhc = <span class="keyword">new</span> QTreeView(<span class="keyword">this</span>);
    tv_tree_ddhc-&gt;setHeaderHidden( <span class="keyword">false</span> );
    tv_tree_ddhc-&gt;setRootIsDecorated( <span class="keyword">true</span> );
    tv_tree_ddhc-&gt;setUniformRowHeights( <span class="keyword">true</span> );
    tv_tree_ddhc-&gt;setMinimumWidth(350);

    <span class="comment">// create the model or get already created instance; assign model to view</span>
    <a class="code" href="class_d_d_h_c_1_1_model.html" title="class representing the root for all debug elements">DDHC::Model</a> * ddhc_mdl =  <a class="code" href="class_d_d_h_c_1_1_model.html#a087ceafaf5b66acd8a31094d9626a2a2" title="get the one and running instance">DDHC::Model::mInst</a>();
    tv_tree_ddhc-&gt;setModel(ddhc_mdl);

    <span class="comment">// finnaly insert the widget</span>
    ui-&gt;centralwidget-&gt;layout()-&gt;addWidget(tv_tree_ddhc);
    tv_tree_ddhc-&gt;expandAll();

<span class="preprocessor">#endif</span>
</pre></div></li>
</ul>
<ul>
<li>DDHC_INHERIT shall be used in the declaration of the class. Current implementation hides an abstract class that is inherited only in debug mode <div class="fragment"><pre class="fragment"><span class="comment">// file: SomeClass1.h</span>

<span class="keyword">class   </span>SomeClass1  : <span class="keyword">public</span> BaseClass, <span class="keyword">public</span> BaseClass2,  <a class="code" href="ddhc__main_8h.html#a11c872f3f4013282773f6329628a4989">DDHC_INHERIT</a>    {
    SomeClass1();
    ~SomeClass1();
};


<span class="comment">// file: SomeClass2.h</span>

<span class="keyword">class   </span>SomeClass2  : <a class="code" href="ddhc__main_8h.html#a11c872f3f4013282773f6329628a4989">DDHC_INHERIT</a>  {
    SomeClass2();
    <span class="keyword">virtual</span> ~SomeClass2();
};
</pre></div></li>
</ul>
<ul>
<li>inside the body of the class the DDHC_CLASS macro shall be used, preferably as the first line; otherwise, be aware that it modifies the access descriptors, leaving the private one active. This will insert required elements inside class body. <div class="fragment"><pre class="fragment"><span class="comment">// file: SomeClass1.h</span>

<span class="keyword">class   </span>SomeClass1  : <a class="code" href="ddhc__main_8h.html#a11c872f3f4013282773f6329628a4989">DDHC_INHERIT</a>  {
    <a class="code" href="ddhc__main_8h.html#a93273add2edbf58828a7c139577170ec">DDHC_CLASS</a>

    SomeClass1();
    <span class="keyword">virtual</span> ~SomeClass1();
};
</pre></div></li>
</ul>
<ul>
<li>because "the results of calling (directly or indirectly) a pure
virtual function from its constructor are undefined" (see <a href="http://publib.boulder.ibm.com/infocenter/comphelp/v8v101/index.jsp?topic=%2Fcom.ibm.xlcpp8a.doc%2Flanguage%2Fref%2Fcplr142.htm">reference page</a>) DDHC_CONSTRUCT shall be used inside the constructors or the initialization function used by the constructors. No matter what implementation is choosen, it should appear only once for a class instance in the flow of code. <div class="fragment"><pre class="fragment"><span class="comment">// file: SomeClass1.cc</span>

SomeClass1::SomeClass1()    {
    <a class="code" href="ddhc__main_8h.html#a5450dfe3c644f059533fb6b0a704d9bf">DDHC_CONSTRUCT</a>;
    <span class="comment">// .. some other stuff</span>
}
</pre></div> or <div class="fragment"><pre class="fragment"><span class="comment">// file: SomeClass1.cc</span>


<span class="comment">// initialization function used by all constructors</span>
<span class="keywordtype">void</span>    init    (<span class="keywordtype">void</span>)      {
    <a class="code" href="ddhc__main_8h.html#a5450dfe3c644f059533fb6b0a704d9bf">DDHC_CONSTRUCT</a>;
    <span class="comment">// .. some other stuff</span>
}

SomeClass1::SomeClass1 ()   {
    init();
    <span class="comment">// .. some other stuff</span>
}

SomeClass1::SomeClass1 ( <span class="keywordtype">int</span> i )    {
    init();
    <span class="comment">// .. some other stuff</span>
}

SomeClass1::SomeClass1 ( <span class="keywordtype">double</span> i ) {
    init();
    <span class="comment">// .. some other stuff</span>
}
</pre></div></li>
</ul>
<ul>
<li>DDHC uses static variables for some of the data it defines; to make this work, a DDHC_CONTENT macro for each class must be used inside a source file. <div class="fragment"><pre class="fragment"><span class="comment">// file: SomeClass1.cc</span>


<span class="preprocessor">#include    &quot;<a class="code" href="main_8h.html" title="Contains global definitions for application.">main.h</a>&quot;</span>

<a class="code" href="ddhc__main_8h.html#abeddf5a2c22a7727d1c96c148d05d9cf">DDHC_CONTENT</a>(SomeClass1);

SomeClass1::SomeClass1()    {
    <a class="code" href="ddhc__main_8h.html#a5450dfe3c644f059533fb6b0a704d9bf">DDHC_CONSTRUCT</a>;
    <span class="comment">// .. some other stuff</span>
}
</pre></div></li>
</ul>
<ul>
<li>DDHC_VARIABLE adds a variable in the tree for a class; it has to be used just after DDHC_CONSTRUCT (the execution shall pass only only once per instance) The variable that is to be viewed must be a valid source for QVariant. <div class="fragment"><pre class="fragment"><span class="comment">// file: SomeClass1.h</span>


<span class="keyword">class   </span>SomeClass1  : DDHC_SINGLE_INHERIT   {
    <a class="code" href="ddhc__main_8h.html#a93273add2edbf58828a7c139577170ec">DDHC_CLASS</a>

    <span class="keywordtype">int</span> i_counter;

    SomeClass1();
    <span class="keyword">virtual</span> ~SomeClass1();
};


<span class="comment">// file: SomeClass1.cc</span>

 SomeClass1::SomeClass1()   {
  <a class="code" href="ddhc__main_8h.html#a5450dfe3c644f059533fb6b0a704d9bf">DDHC_CONSTRUCT</a>;
  <a class="code" href="ddhc__main_8h.html#abe1f2d96d3d620116d512432989392b3">DDHC_VARIABLE</a>(i_counter);
  <span class="comment">// .. some other stuff</span>
 }
</pre></div></li>
</ul>
<ul>
<li>DDHC_NODE adds a class rooted inside this one; the class may be embedded or not; <div class="fragment"><pre class="fragment"><span class="comment">// file: SomeClass1.h</span>


<span class="keyword">class   </span>SomeClass1  : DDHC_SINGLE_INHERIT   {
    <a class="code" href="ddhc__main_8h.html#a93273add2edbf58828a7c139577170ec">DDHC_CLASS</a>


    <span class="keywordtype">int</span> i_counter;
    SomeClass2      cl_inst;
    SomeClass2 *    cl_another_inst;

    SomeClass1();
    <span class="keyword">virtual</span> ~SomeClass1();

};


<span class="comment">// file: SomeClass1.cc</span>


 SomeClass1::SomeClass1()   {
  <a class="code" href="ddhc__main_8h.html#a5450dfe3c644f059533fb6b0a704d9bf">DDHC_CONSTRUCT</a>;
  <a class="code" href="ddhc__main_8h.html#abe1f2d96d3d620116d512432989392b3">DDHC_VARIABLE</a>(i_counter);
  <a class="code" href="ddhc__main_8h.html#aa520aae0ac8ff4633ace4be388871393">DDHC_NODE</a>(&amp;cl_inst);
  <a class="code" href="ddhc__main_8h.html#aa520aae0ac8ff4633ace4be388871393">DDHC_NODE</a>(&amp;cl_another_inst);
  <span class="comment">// .. some other stuff</span>
 }
</pre></div> </li>
</ul>
</div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="main.html">EquTemper source code documentation</a>      </li>
      <li class="navelem"><a class="el" href="ddhc_main_page.html">Dynamic Debug Helper Code (DDHC)</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

    <li class="footer">Generated on Sun Oct 23 2011 22:06:49 for EquTemper by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.4 </li>
   </ul>
 </div>
</body>
</html>
